Add converse actions & maintenance - #46
Open
ospaarmann wants to merge 16 commits into
Open
Conversation
…d_crc32_checksum_support Add crc32 checksum support, bump library versions, fix stream parsing and tests
Owner
|
Thanks for doing this @ospaarmann - we have been using the Converse API (in other BEAM language) and it's great. |
…quest
On a non-200 response stream_objects!/3 raised ExAws.Error with only
"#{status}: #{reason}", discarding the response body and the
x-amzn-ErrorType header and leaking the hackney ref. Callers could not
tell throttling from capacity rejection from a permanent client error.
The non-200 path now drains headers and body (bounded receives), closes
the request, and raises ExAws.Bedrock.HttpError{status, error_type}
with a truncated body in the message. The stream's after_fun closes the
ref on abandoned enumeration. The 200 path is unchanged.
Callers rescuing ExAws.Error on the streaming path should add
ExAws.Bedrock.HttpError to their rescue list.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RGEBFJtBat8xazB73oHFjM
…mpty error type Review findings: a byte-level cut at the body limit can split a multibyte codepoint and make the exception message invalid UTF-8 (breaking JSON serialization of the very error report); drain was per-receive bounded but not total-size bounded; malformed x-amzn-errortype values normalized to "" instead of nil. Also names HttpError in the stream_objects! doc. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RGEBFJtBat8xazB73oHFjM
The request fn and the Stream.resource next fn were anonymous closures with receives nested five levels deep. open_stream/await_status handle the request phase, next_event/await_event the streaming phase, each a flat pattern match. No behavior change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RGEBFJtBat8xazB73oHFjM
Satisfies Credo.Check.Readability.SinglePipe, which CI gates on. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RGEBFJtBat8xazB73oHFjM
Preserve status and error body on event stream failures, close the request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added support for the actions
ConverseandConverseStreamsince they offer a unified interface to interact with different models available on Bedrock and are the recommended way when using Tool Calling.I also did some maintenance (bump dependency versions) and made sure all tests pass.
And I included the code from the PR that @holsee raised. I don't want to hijack your code, I just wanted to include your changes and your PR was open for a very long time. I hope this is ok. Maybe the maintainers can first merge your PR, since it is identical.
I hope someone sees this, since the library hasn't been active in some time.
Resources: